<p id="title">  <?php  echo $this->title; ?>  </p>
<?php
$b = '';
$t = 0;
$a = "'" . $_GET ["_module"] . "'";
// iDebug::debugArray($this->object);
echo '<table class = "table">';
echo '<thead class = "thead">';
echo '<tr>';
foreach ( $this->object as $entity ) {
	echo '<th></th>';
	foreach ( $entity as $k => $v ) {
		if (($k != "pointend") && ($k != "pointstart") && ($k != "id"))
			echo '<th>' . Resource::getResource ( $k ) . '</th>';
		if ($k == "pointstart")
			echo '<th>' . Resource::getResource ( "trip" ) . '</th>';
	}
	break;
}
echo '</tr>';
echo '</thead>';
echo '<tbody class="tbody">';
$ticket = new Ticket();
$sum = count($ticket->getall());
$display = 10;
$page = ceil($sum/$display);
$i = 1;
$hihi = 0;
echo '<div class="subpage" ><ul>';
do{
	echo '<li>';
	if(isset($_GET['start']) && (int)$_GET['start'] == ($hihi*$display))
		echo '<a style="background : white;">'.($hihi+1).'</a>';
	else
		echo '<a href = "'.Config::BASEURL.'?_module=Ticket&_action=getAll&start='.($display * $hihi).'">'.($hihi+1).'</a>';
	echo '</li>';
	$hihi+=1;
}while ($hihi < $page);
echo '</div></ul>';
foreach ( $this->object as $value ) {
	if ($t == 0) {
		echo '<tr class="a">';
		$t = 1;
	} else {
		echo '<tr class="b">';
		$t = 0;
	}
	echo '<td class="delete"><img id="imgdelete' . $value ['id'] . '" onmouseover="changeImageDel(' . $value ['id'] . ')" src="' . Config::BASEURL . 'layout/default/image/empty.png" onclick="deleteajax(' . $a . ',' . $value ['id'] . ')" style="width :32px;height :32px"></td>';
	echo '<td>' . $value ['code'] . '</td>';
	echo '<td class="name"><a href="' . Config::BASEURL . '?_module=' . $_GET ['_module'] . '&_action=edit&_' . $_GET ['_module'] . 'id=' . $value ['id'] . '' . '">' . $value ['pointstart'] . '-' . $value ['pointend'] . '</a></td>';
	echo '<td>' . $value ['customer'] . '</td>';
	echo '<td>' . $value ['seat'] . '</td>';
	
	if ($value ['status'] == 0)
		echo '<td class="status"><img id="x' . $value ['id'] . '" src="' . Config::BASEURL . 'layout/default/image/uncheck.png" onclick="changestatus(' . $a . ',' . $value ['id'] . ',' . $value ['status'] . ')"></td>';
	else if ($value ['status'] == 1)
		echo '<td class="status"><img id="x' . $value ['id'] . '" src="' . Config::BASEURL . 'layout/default/image/check.png" onclick="changestatus(' . $a . ',' . $value ['id'] . ',' . $value ['status'] . ')"></td>';
	else
		echo '<td class="status"><img id="x' . $value ['id'] . '" src="' . Config::BASEURL . 'layout/default/image/busy.png" onclick="changestatus(' . $a . ',' . $value ['id'] . ',' . $value ['status'] . ')"></td>';
	echo '</tr>';
}
echo '</tbody>';
echo '</table>';
?>



